home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
archiver
/
darc.arc
/
DARC.DOC
next >
Wrap
Text File
|
1988-03-14
|
10KB
|
228 lines
Documentation for DARC-Utility for Atari ST
===========================================
written by: Gunnar Teege
Technische Universitaet Muenchen
D-8000 Muenchen
Version 1.1 (Dec. 87)
Introduction:
-------------
DARC is a utility for archiving whole folder-trees from the
TOS file system into a single file preserving the tree
structure. The contents of the tree is compressed, so that
the archive will need only about 50 to 70 % of the space
the tree needed.
The compression and collecting of many files into a single
one is done by the already existing utility ARC. THIS PROGRAM
IS NEEDED TO RUN DARC! DARC is only a frame program that
runs through the tree (well, perhaps 'walk' fits better here,
when the tree is on a floppy) collecting everything it finds
and feeding it into the ARC program.
When DARC is applied to a 'flat' tree (i.e. a folder not con-
taining any subfolders) you get the same result as if you
simply ARC all files in the folder. (This is just what DARC
does in this case).
DARC uses the following features of ARC:
a - add files to archive
m - move files to archive
d - delete files from archive
x - extract files from archive
where 'a' and 'm' sometimes are combined with option
s - suppress compression
DARC relys on the facts that ARC
- puts all extracted files in the current folder
- can use absolute pathnames for both the archive name and
the file names
- does expansion of xxx.* and *.* the right way when given
to specify the files to add or move into the archive and
automatically leaves out any folders matching these names
(I have the ARC - Version made by Harvey Johnson and hope that
all other (if existing) work the same way.)
DARC is written in C and compiled with Megamax.
Usage:
------
The DARC call is as follows:
DARC.TTP [c|x]{f|m} <archive> <root>
where
c = create archive from tree
x = extract tree from archive
f = fast version
m = move; don't preserve source
<archive> = Name of archive file
<root> = Name of the root - folder of the tree
'f' and 'm' are optional and change only the way of working.
The archives are always identical.
<archive> and <root> can be absolute pathnames or relative
to the current folder.
<root> can also be the name of a disk station of the form
A:
In this case the whole contents of the disk is put in the archive
when creating or the disk is used as root of the tree when
extracting.
When creating the archive <archive> must not exist and <root>
must exist and be a folder or disk station. When extracting
<archive> must exist and <root> must be a disk station or
must not exist (it is created by DARC - of course you can't
do this with a disk station).
IMPORTANT: The ARC utility must reside in the same folder
as the archive and must have the name ARC.TTP. So if you say
DARC.TTP c C:\work\games.arc A:
you need ARC.TTP in folder work on disk C:
METHOD:
-------
So, of course you are interested in how it's done. (If not,
stop reading and start using). The way to create an archive
is simple to describe:
- recursively create an archive from each subfolder of
<root> (if there are any)
- build a table mapping subarchive names to folder names
- put all subarchives, the table and all ordinary files
in <root> into the archive.
(Yes, I like recursion very much. Efficiency? Well - I want to
use DARC to maintain backup copies of my program floppys.
So it's not a program for everyday use (I HOPE!).)
The subarchives are called
DARC§%<level>.<no>
where <level> is a two-digit number describing the level of
the corresponding subfolders in the tree. Subfolders in the
root have level 1. <no> is the tree-digit number of the sub-
archive in its folder. The first subarchive always has number 1.
The table for a folder has the name
DARC§%<level>.000
where <level> is the level of the subarchives described. So
the table for the root folder is called DARC§%01.000 .
The table simply contains the name for the first subfolder
(corresponding to subarchive DARC§%<level>.001) in the fist
line, the name for the next (corresponding to DARC§%<level>.002)
in the second line and so on.
In the case a subfolder is empty (contains no files or folders)
no subarchive is created. Only the foldername is recorded in
the table. (This applies to the root too: if you DARC an empty
folder DARC does NOTHING.)
Now the details: where to put the intermediate files an when.
This should be important for people with not so much disk
space. But please remember what applies to the whole next
section: I can only tell for the intermediate archives used
by DARC. I don't know how much workspace ARC needs on disk
when adding to or extracting from a file. In my tests I found,
for adding to an archive it seems to copy the whole archive.
So it needs about once the space for the archive in use
additionally to the numbers given in the following section.
I use the term 'workdir' for the folder, the archive is (or
will be) in (and the ARC.TTP; see above).
You have the choice between three ways, DARC does it's job.
The normal way is used, when you give no options in the
command line. In this case, when creating an archive, DARC
starts with the subfolders. For each one it creates the subarchive
in the workdir, puts it in the archive (in the workdir) and
deletes the subarchive. While doing this, the table file is
built in the workdir. After all subfolders are done, the table
and the normal files are added to the archive. So at any given
time in the workdir you have the half-done archives for each
level in the tree on the path from root to the current folder.
In the worst case this is about twice the size the archive has
when finished.
When extracting, DARC works like this: It creates the root,
changes into it, and extracts all files from the archive.
If there are subarchives, it moves each subarchive into the
workdir, extracts the tree in it and deletes the subarchive in
the workdir before going on to the next one. Thus at any given
time you find only the main archive and one subarchive in the
workdir. In the worst case this needs again about twice the
space for the main archive in the workdir (consider a tree
containing only one large subfolder). As archives nearly always
are smaller then the corresponding trees, no extra space is
needed on the disk where the tree is put (it should work well
to DARC and unDARC full floppys).
If you specify the option 'f' ('fast') in the command line DARC
tries to work faster but needs more space in the workdir. When
creating the archive ALL subarchives are collected in the workdir
before archiving them. When extracting, the subarchives are
extracted in the workdir and then deleted in the archive before
the normal files are extracted in the destination folder.
This is faster when the workdir is on hard- or ramdisk and the
destination is on floppy. Of course it will be slower than without
the option if the workdir is on floppy (why should something
need less time only because it is done with an option called
'fast'...).
If you are short with space for your workdir you should use
the option 'm' ('move'). It trades place for time and works
like this: When creating the archive, after creating a subarchive
in the workdir the subfolder is deleted and the subarchive moved
to its place. So you have only one (sub)archive in the workdir
at any given time (plus the table file(s)). This needs only
about as much place as the main archive when it's done. On the
other hand your tree is eaten away